package vip.source.pattern.part22.visitor;

import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import vip.source.pattern.part22.visitor.domain.DataView;
import vip.source.pattern.part22.visitor.visitor.impl.Parent;
import vip.source.pattern.part22.visitor.visitor.impl.Principal;

/**
 * @Description: 测试访问者模式
 * @Author: zy
 **/
public class UnitTest {
    private Logger logger = LoggerFactory.getLogger(UnitTest.class);

    @Test
    public void test() {
        DataView dataView = new DataView();

        logger.info("\r\n家长视角访问：");
        dataView.show(new Parent());     // 家长

        logger.info("\r\n校长视角访问：");
        dataView.show(new Principal());  // 校长
    }
}
